package com.fc.test.compare;

import com.fc.test.compare.define.CompareInterface;
import com.fc.test.compare.define.CompareResult;
import com.fc.test.model.auto.TableConfig;
import org.slf4j.MDC;

/**
 * Created by Liaopan on 2019/7/4.
 */
public class CompareTask extends AbstractCompareThread {

    private CompareInterface compare;

    public CompareTask(TableConfig tableConfig, CompareInterface compare) {
        super(tableConfig);
        this.compare = compare;
    }

    public CompareResult taskRun(String sourceQuery, String targetQuery) throws Exception {
        compare.init(sourceDataSource, targetDataSource,sourceClass,targetClass);
        return compare.compare(sourceQuery,targetQuery);
    }

}
